import {request} from "../utils/request";

//互娱师相关的接口
//线下互娱的接口
export async function OfflineGamer(data) {
    const res = await request({
        url: `/gamer/offlineGamer`,
        method: 'GET',
        data
    }).catch()
    return res
}

//获取互娱师详细信息的接口
export async function GetOnGamer(data) {
    const res = await request({
        url: `/gamer/oneGamer`,
        method: 'Get',
        data
    }).catch()
    return res
}

//收藏互娱师的接口
export async function SaveGamer(data) {
    const res = await request({
        url: `/gamer/saveGamer`,
        method: 'POST',
		header:{
		    'content-type':'application/x-www-form-urlencoded'
		},
        data
    }).catch()
    return res
}

//互娱师附件推荐
export async function nearbyGamer(data) {
    const res = await request({
        url: `/gamer/nearbyGamer`,
        method: 'GET',
        data
    }).catch()
    return res
}

//提交互娱师信息
export async function addGamer(data) {
    const res = await request({
        url: `/gamer/addGamer`,
        method: 'POST',
        data
    }).catch()
    return res
}

//修改互娱师信息
export async function editGamer(data) {
    const res = await request({
        url: `/gamer/updateGamer`,
        method: 'PUT',
        data
    }).catch()
    return res
}


//通过用户id查找互娱师
export async function getGamerByUserId(data) {
    const res = await request({
        url: `/gamer/selectOneGamerByUserId`,
        method: 'GET',
        data
    }).catch()
    return res
}

//随机获取互娱师
export async function getRandomGamer(data) {
    const res = await request({
        url: `/gamer/randomGamer`,
        method: 'GET',
        data
    }).catch()
    return res
}

// 通过互娱师id查询互娱师详细信息
export async function selectGamer(data){
	const res = await request({
		url: `/gamer/selectOneGamerByGamerId`,
		method:"GET",
		data
	}).catch()
	return res
}

// 上传互娱师图片
export async function uploadGamerImg(data){
    const res = await request({
        url: `/image`,
        method:"POST",
        data
    }).catch()
    return res
}

// 删除互娱师图片
export async function delGamerImg(data){
    const res = await request({
        url: `/image`,
        method:"DELETE",
        data
    }).catch()
    return res
}

// 获取互娱师标签
export async function getGammerLable(){
	const res = await request({
		url:"/userlabel/gamer",
		method:"get",
	}).catch()
	return res
}

// 修改互娱师标签
export async function updateGammerLabel(data){
	const res = await request({
		url:"/userlabel/gamer",
		method:"put",
		data
	}).catch()
	return res
}

// 修改是否上班
export async function updateBinding(data){
	const res = await request({
		url:"/gamer/updateGamerBinding",
		method:"PUT",
		header:{
		    'content-type':'application/x-www-form-urlencoded'
		},
		data
	}).catch()
	return res
}